*************************************************************************************************
* Documentation for Reproduction of
* You Wouldn't Like Me When I'm Angry: List Experiment Misreporting
* Social Science Quarterly 92(2): 552-562 
* L.J Zigerell
* Stata version 9
*************************************************************************************************
*************************************************************************************************
/* open the 1991 National Race and Politics Survey dataset */
*************************************************************************************************

* create variables

tab list
tab list, nol /* this variable indicates the number of items selected by the respondent */

tab rlst
tab rlst, nol /* this variable indicates the randomized group for the respondent */

gen baseline = rlst
recode baseline (2/3=0)
tab baseline /* this variable indicates a respondent in the baseline control group */

gen blackfam = rlst
recode blackfam (1 3=0) (2=1)
tab blackfam /* this variable indicates a respondent in the black family group */

gen aaction = rlst
recode aaction (1/2=0) (3=1)
tab aaction /* this variable indicates a respondent in the affirmative action group */

tab region
tab region, nol mi
gen south = region
recode south (2/8=0)
tab south /* this variable indicates a respondent from the south */

tab race
tab race, nol mi
gen white = race
recode white (6=1) (1/5 7/99=0)
tab white /* this variable indicates a white respondent */

gen black = race
recode black (2/99=0)
tab black /* this variable indicates a black respondent */

tab list rlst if white==1, nol
tab list rlst if white==1, nol mi
*************************************************************************************************
*************************************************************************************************
* replicate Kuklinski, Cobb, and Gilens (1997) results, Table 1, p. 329

summ list if baseline == 1 & white == 1 & south == 1 [iw=pswt]
summ list if blackfam == 1 & white == 1 & south == 1 [iw=pswt]
summ list if aaction  == 1 & white == 1 & south == 1 [iw=pswt]

summ list if baseline == 1 & white == 1 & south == 0 [iw=pswt]
summ list if blackfam == 1 & white == 1 & south == 0 [iw=pswt]
summ list if aaction  == 1 & white == 1 & south == 0 [iw=pswt]

summ list if baseline == 1 & white == 1
summ list if aaction  == 1 & white == 1

ttest list if baseline == 1 | aaction == 1, by(baseline) unp une

tab sex if baseline == 1 & white == 1
tab sex if aaction == 1 & white == 1

sum age if baseline == 1 & white == 1
sum age if aaction == 1 & white == 1

tab educ if baseline == 1 & white == 1
tab educ if aaction == 1 & white == 1

sum educ if baseline == 1 & white == 1
sum educ if aaction == 1 & white == 1

tab mrtl if baseline == 1 & white == 1
tab mrtl if aaction == 1 & white == 1

tab pid if baseline == 1 & white == 1
tab pid if aaction == 1 & white == 1

tab ideo if baseline == 1 & white == 1
tab ideo if aaction == 1 & white == 1

tab reli if baseline == 1 & white == 1
tab reli if aaction == 1 & white == 1

sum th3 if baseline == 1 & white == 1
sum th3 if aaction == 1 & white == 1

sum s9 if baseline == 1 & white == 1
sum s9 if aaction == 1 & white == 1

tab m1g if baseline == 1 & white == 1
tab m1g if aaction == 1 & white == 1

sum va6 if baseline == 1 & white == 1
sum va6 if aaction == 1 & white == 1

*************************************************************************************************
*************************************************************************************************
* create stereotype disagreement index

gen b = 0

// dependable
tab s1
replace b = b + 1 if s1 == 10

// school intelligent
tab s2
replace b = b + 1 if s2 == 10

// aggressive
tab s3
replace b = b + 1 if s3 == 0

// lazy
tab s4
replace b = b + 1 if s4 == 0

// everyday smart
tab s5
replace b = b + 1 if s5 == 10

// law abiding
tab s6
replace b = b + 1 if s6 == 10

// boastful
tab s7
replace b = b + 1 if s7 == 0

// determined to succeed
tab s8
replace b = b + 1 if s8 == 10

// hardworking
tab s9
replace b = b + 1 if s9 == 10

// friendly
tab s10
replace b = b + 1 if s10 == 10

// irresponsible
tab s11
replace b = b + 1 if s11 == 0

// keep up property
tab s12
replace b = b + 1 if s12 == 10

// complaining
tab s13
replace b = b + 1 if s13 == 0

// good neighbors
tab s14
replace b = b + 1 if s14 == 10

tab b if white == 1
summ b if white == 1

tab b if black == 1
summ b if black == 1

*************************************************************************************************
*************************************************************************************************
* Table 1

// Baseline means
summ list if baseline == 1 & white == 1 & b==0 [iw=pswt]
summ list if baseline == 1 & white == 1 & b>0  [iw=pswt]
summ list if baseline == 1 & white == 1 & b>1  [iw=pswt]
summ list if baseline == 1 & white == 1 & b>2  [iw=pswt]
summ list if baseline == 1 & white == 1 & b>3  [iw=pswt]

// Black family means
summ list if blackfam == 1 & white == 1 & b==0 [iw=pswt]
summ list if blackfam == 1 & white == 1 & b>0  [iw=pswt]
summ list if blackfam == 1 & white == 1 & b>1  [iw=pswt]
summ list if blackfam == 1 & white == 1 & b>2  [iw=pswt]
summ list if blackfam == 1 & white == 1 & b>3  [iw=pswt]

// Affirmative Action means
summ list if aaction  == 1 & white == 1 & b==0 [iw=pswt]
summ list if aaction  == 1 & white == 1 & b>0  [iw=pswt]
summ list if aaction  == 1 & white == 1 & b>1  [iw=pswt]
summ list if aaction  == 1 & white == 1 & b>2  [iw=pswt]
summ list if aaction  == 1 & white == 1 & b>3  [iw=pswt]

*************************************************************************************************
*************************************************************************************************
* 

svyset [pw=pswt]

// baseline means
svy: mean list if baseline == 1 & white == 1 & b == 0 /* Table 1 Column 1 Row 1 */
svy: mean list if baseline == 1 & white == 1 & b > 0  /* Table 1 Column 2 Row 1 */
svy: mean list if baseline == 1 & white == 1 & b > 1  /* Table 1 Column 3 Row 1 */
svy: mean list if baseline == 1 & white == 1 & b > 2  /* Table 1 Column 4 Row 1 */
svy: mean list if baseline == 1 & white == 1 & b > 3  /* Table 1 Column 5 Row 1 */

// black family means
svy: mean list if blackfam == 1 & white == 1 & b == 0 /* Table 1 Column 1 Row 2 */
svy: mean list if blackfam == 1 & white == 1 & b > 0  /* Table 1 Column 2 Row 2 */
svy: mean list if blackfam == 1 & white == 1 & b > 1  /* Table 1 Column 3 Row 2 */
svy: mean list if blackfam == 1 & white == 1 & b > 2  /* Table 1 Column 4 Row 2 */
svy: mean list if blackfam == 1 & white == 1 & b > 3  /* Table 1 Column 5 Row 2 */

// affirmative Action means
svy: mean list if aaction  == 1 & white == 1 & b == 0 /* Table 1 Column 1 Row 6 */
svy: mean list if aaction  == 1 & white == 1 & b > 0  /* Table 1 Column 2 Row 6 */
svy: mean list if aaction  == 1 & white == 1 & b > 1  /* Table 1 Column 3 Row 6 */
svy: mean list if aaction  == 1 & white == 1 & b > 2  /* Table 1 Column 4 Row 6 */
svy: mean list if aaction  == 1 & white == 1 & b > 3  /* Table 1 Column 5 Row 6 */

// weighted t-values for black family condition
reg list baseline if aaction  == 0 & white == 1 & b == 0 [pw=pswt] /* Table 1 Column 1 Row 3 */
reg list baseline if aaction  == 0 & white == 1 & b > 0 [pw=pswt]  /* Table 1 Column 2 Row 3 */
reg list baseline if aaction  == 0 & white == 1 & b > 1 [pw=pswt]  /* Table 1 Column 3 Row 3 */
reg list baseline if aaction  == 0 & white == 1 & b > 2 [pw=pswt]  /* Table 1 Column 4 Row 3 */
reg list baseline if aaction  == 0 & white == 1 & b > 3 [pw=pswt]  /* Table 1 Column 5 Row 3 */

// weighted t-values for affirmative action condition
reg list baseline if blackfam == 0 & white == 1 & b == 0 [pw=pswt] /* Table 1 Column 1 Row 8 */
reg list baseline if blackfam == 0 & white == 1 & b > 0 [pw=pswt]  /* Table 1 Column 2 Row 8 */
reg list baseline if blackfam == 0 & white == 1 & b > 1 [pw=pswt]  /* Table 1 Column 3 Row 8 */
reg list baseline if blackfam == 0 & white == 1 & b > 2 [pw=pswt]  /* Table 1 Column 4 Row 8 */
reg list baseline if blackfam == 0 & white == 1 & b > 3 [pw=pswt]  /* Table 1 Column 5 Row 8 */

// unweighted t-values for black family condition
reg list baseline if aaction  == 0 & white == 1 & b == 0 /* Table 1 Column 1 Row 5 */
reg list baseline if aaction  == 0 & white == 1 & b > 0  /* Table 1 Column 2 Row 5 */
reg list baseline if aaction  == 0 & white == 1 & b > 1  /* Table 1 Column 3 Row 5 */
reg list baseline if aaction  == 0 & white == 1 & b > 2  /* Table 1 Column 4 Row 5 */
reg list baseline if aaction  == 0 & white == 1 & b > 3  /* Table 1 Column 5 Row 5 */

// unweighted t-values for affirmative action condition
reg list baseline if blackfam == 0 & white == 1 & b == 0 /* Table 1 Column 1 Row 9 */
reg list baseline if blackfam == 0 & white == 1 & b > 0  /* Table 1 Column 2 Row 9 */
reg list baseline if blackfam == 0 & white == 1 & b > 1  /* Table 1 Column 3 Row 9 */
reg list baseline if blackfam == 0 & white == 1 & b > 2  /* Table 1 Column 4 Row 9 */
reg list baseline if blackfam == 0 & white == 1 & b > 3  /* Table 1 Column 5 Row 9 */

// unweighted t-values from t-tests
ttest list if aaction  == 0 & white == 1 & b == 0, by(blackfam) unp une
ttest list if aaction  == 0 & white == 1 & b > 0, by(blackfam) unp une
ttest list if aaction  == 0 & white == 1 & b > 1, by(blackfam) unp une
ttest list if aaction  == 0 & white == 1 & b > 2, by(blackfam) unp une
ttest list if aaction  == 0 & white == 1 & b > 3, by(blackfam) unp une

ttest list if blackfam == 0 & white == 1 & b == 0, by(aaction) unp une
ttest list if blackfam == 0 & white == 1 & b > 0, by(aaction) unp une
ttest list if blackfam == 0 & white == 1 & b > 1, by(aaction) unp une
ttest list if blackfam == 0 & white == 1 & b > 2, by(aaction) unp une
ttest list if blackfam == 0 & white == 1 & b > 3, by(aaction) unp une

*************************************************************************************************
*************************************************************************************************
* Figure 2

tab list if baseline == 1 & white == 1 & b > 2 [iw=pswt] /* Page 557 */
tab list if blackfam == 1 & white == 1 & b > 2 [iw=pswt] /* Page 557 */
tab list if baseline == 1 & white == 1 & b > 2
tab list if blackfam == 1 & white == 1 & b > 2

*************************************************************************************************
*************************************************************************************************
*  Conclusion

sum list if b>1 & south == 1
sum list if b>1 & south == 0
sum list if b>1 & south == 1 & baseline == 1
sum list if b>1 & south == 1 & blackfam == 1
sum list if b>1 & south == 1 & aaction == 1

*************************************************************************************************
*************************************************************************************************
* Randomization checks

ttest sex if white==1, by(baseline)
ttest sex if white==1, by(blackfam)
ttest sex if white==1, by(aaction)

ttest age if white==1, by(baseline)
ttest age if white==1, by(blackfam)
ttest age if white==1, by(aaction)

ttest educ if white==1, by(baseline)
ttest educ if white==1, by(blackfam)
ttest educ if white==1, by(aaction)

ttest south if white==1, by(baseline)
ttest south if white==1, by(blackfam)
ttest south if white==1, by(aaction)

ttest b if white==1, by(baseline)
ttest b if white==1, by(blackfam)
ttest b if white==1, by(aaction)

*************************************************************************************************
*************************************************************************************************
* Correlations

pwcorr b list if white==1, sig obs
pwcorr b list if white==1 & baseline==0, sig obs
pwcorr b list if white==1 & baseline==1, sig obs
pwcorr b list if white==1 & blackfam==1, sig obs
pwcorr b list if white==1 & aaction==1, sig obs

*************************************************************************************************
*************************************************************************************************
* Ceiling effect check

gen ceiling = .
recode ceiling (.=1) if list == 3 & baseline == 1 & white == 1
recode ceiling (.=0) if list == 2 & baseline == 1 & white == 1
recode ceiling (.=0) if list == 1 & baseline == 1 & white == 1
recode ceiling (.=0) if list == 0 & baseline == 1 & white == 1
pwcorr ceiling b, sig obs
ttest b if white==1 & baseline==1, by(ceiling)

tab b if white==1 & list==3 & baseline==1
tab b if white==1 & list<3 & list>=0 & baseline==1
*************************************************************************************************
